<!--
	作者：2575202388@qq.com
	时间：2018-10-19
	描述：公用表格组件
-->
<template>
	<span>
			{{descript}}
	</span>
</template>

<script>
	export default {
		name: "Translate",
		props: {
			dmjc:{
				type:String,
				default:''
			},
			values:{
				type:String,
				default:''
			}
		},
		data() {
			return {
				datas: [],
				descript:''
			}
		},
		methods: {
			getDetail(){
				this.descript="";
				if(this.dmjc!="" && this.values!=""){
					this.datas=this.dmxx[this.dmjc];
				}else{
					return;
				}
				const sz=this.values.split(",");
				this.datas.forEach(dmx=>{	
					if(this.dmjc=="XZQH"){
						this.descript=dmx.DMX_MC
					}else{
						if(sz.includes(dmx.DMX_BH)){
							if(this.descript==""){
								this.descript=dmx.DMX_MC
							}else{
								this.descript+=","+dmx.DMX_MC
							}
						}
					}
				})	
			}
		},
		mounted() {
			this.getDetail();
		},
		watch:{
			values(news){
				this.getDetail();
			}
		},
		computed: {
			dmxx: function() {
				return this.$store.state.app.dmxx;
			}
		}
	}
</script>

<style>
	
</style>

<style>

</style>